package com.antunnel.system.service.impl;

import java.util.Date;
import org.springframework.stereotype.Service;
import com.antunnel.common.orm.BaseServiceImpl;
import com.antunnel.common.util.DateUtils;
import com.antunnel.system.service.LoginService;

@Service
public class LoginServiceImpl extends BaseServiceImpl implements  LoginService{

	/**
	 * 如果当前登录人的activetime小于当前时间14天，则算作逾期返回true,大于等于14天不算逾期返回false
	 * 如果当前登录人的activetime大于等于当前时间,不算逾期返回false
	 */
	public Boolean checkUserLoginExpired(Date activetime) throws Exception {
		Date nowtime = new Date();
		if(nowtime.after(activetime)){
			int num=DateUtils.getIntervalDays(activetime,nowtime);
			return num>14 ?true :false;
		}else{
			return false;
		}
	}
}
